package com.zim.ta_service.support.generator;

import cn.hutool.core.collection.ListUtil;
import com.zim.ta_service.base.enums.OnOffEnum;
import com.zim.ta_service.support.generator.common.CodeGeneratorBase;
import com.zim.ta_service.support.generator.common.vo.GeneratorSettingVo;

/**
 * author: alabimofa <br>
 * date: 2021/10/15 17:50 <br>
 */
public class CodeGenerator extends CodeGeneratorBase {
	@Override
	protected GeneratorSettingVo customSetting(GeneratorSettingVo vo) {
		vo.setAuthorName("alabimofa");
		// 模块名，生成entity、mapper、service时包名最后会添加一层该模块名
		// 例：bizModuleName为test，则生成的entity包路径为com.delai.abi.entity.test
		vo.setBizModuleName("opcUaBreakSummary");

		// 数据库连接配置
		vo.setDbUrl("jdbc:mysql://10.8.0.17:60005/pump?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true");
		vo.setDbUserName("root");
		vo.setDbPassword("PumpRoot@2021");

		//是否生成文件
		//ON：生成 OFF：不生成
		vo.setServiceGenerateSwitch(OnOffEnum.ON);
		vo.setEntityGenerateSwitch(OnOffEnum.ON);
		vo.setMapperGenerateSwitch(OnOffEnum.ON);

		//需要自动生成的表名一览
		vo.setTableList(ListUtil.toList("opc_ua_break_summary"));
		return vo;
	}

	public static void main(String[] args) {
		CodeGenerator generator = new CodeGenerator();
		generator.doGenerator();
	}
}
